package com.example.chapter09.service;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

public class TestService extends Service {
    public TestService() {
    }

    @Override
    public void onCreate() {
        super.onCreate();
    }

    @Override
    public IBinder onBind(Intent intent) {
        return new MyBinder();
    }

    //创建服务代理 调用其中的方法
    class MyBinder extends Binder {

//        methodInService()
    }

    public void methodInService() {
        Log.d("TestService", "这是服务中的方法");
    }

    //解绑
    @Override
    public boolean onUnbind(Intent intent) {
        return super.onUnbind(intent);
    }
}